<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="div1">div1</div>
		<div id="div2">div2</div>
		<div id="div3">div3</div>
		<div class="c1">div4</div>
		<div class ="c1">div5</div>
		<input type="text" name="username"/>
		
		<script type="text/javascript">
			var divs = document.getElementsByTagName("div");
			
			var cls = document.getElementsByName("c1");
			
			var uname = document.getElementsByName("username");
			alert(uname.length)
		</script>
	</body>
</html>
